package lab02.text21;

/**
 * Created by HASEE on 2017/11/2.
 */
public class Text {
    public static void main(String[] args) {
        char c = '6';
        String string = "123344466674589263425242411";
        System.out.println(getCharCount(c, string));
    }

    public static int getCharCount(char c, String string){
        int count = 0;
        for (int i = 0; i < string.length(); i++) {
            char temp = string.charAt(i);
            if(c == temp)
                count ++;
        }
        return count;
    }


}
